<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        
       html,body,.box{
            width: 100%;
            height: 100%;
           
        }
        .top{
            width: 600px;
            height: 50px;
            display: flex;
            margin: 10px auto;
        }
        .top div{
                width: 20px;
                height: 20px;
                margin-left: 20px;
            }
        .pink{
            background-color: pink;
            border: 10px solid pink;
        }
        .skyblue{
            background-color: skyblue;
            border: 10px solid skyblue;
        }
        .aqua{
            background-color: aqua;
            border: 10px solid aqua;
        }
        .content{
            width: 324px;
            height: 30px;
            margin: 10px auto;
            color: green;
        }
        ul{
            width: 100%;
            height: 100%;
            display: flex;
            list-style: none;
           
        }
        li{
            border: 1px solid black;
            padding: 0 10px;
            font-weight: bolder;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="top">
            <div class="pink" onclick="cone()"></div>
            <div class="skyblue" onclick="ctwo()"></div>
            <div class="aqua" onclick="cthree()"></div>
        </div>
        <div class="content">
            <ul>
                <li>新闻</li>
                <li>娱乐</li>
                <li>体育</li>
                <li>电影</li>
                <li>音乐</li>
                <li>旅游</li>
            </ul>
        </div>
    </div>
</body>
<script>
    var box = document.getElementsByClassName('box')[0]
    var content = document.getElementsByClassName('content')[0]
    var pink = document.getElementsByClassName('pink')[0]
    var skyblue = document.getElementsByClassName('skyblue')[0]
    var aqua = document.getElementsByClassName('aqua')[0]

    function cone(){
        box.style.backgroundColor = "red"
        content.style.backgroundColor = "yellow"
        pink.style.borderColor = "black"
        skyblue.style.borderColor = ""
        aqua.style.borderColor = ""
        // console.log(1111);
    }
    function ctwo(){
        box.style.backgroundColor = "blue"
        content.style.backgroundColor = "orange"
        skyblue.style.borderColor = "black"
        aqua.style.borderColor = ""
        pink.style.borderColor = ""
    }
    function cthree(){
        box.style.backgroundColor = "greenyellow"
        content.style.backgroundColor = "pink"
        aqua.style.borderColor = "black"
        skyblue.style.borderColor = ""
        pink.style.borderColor = ""
    }
</script>
</html>